<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html >
<head>

<link rel="stylesheet" href="../js/dijit/themes/claro/claro.css">
	
<script>dojoConfig = {async: true}</script>
<script src='../js/dojo/dojo.js.uncompressed.js'></script>
<script>require([
    "dojo/ready", "dojo/_base/window", "dojo/store/Memory",
    "dijit/tree/ObjectStoreModel", "dijit/Tree"
], function(ready, win, Memory, ObjectStoreModel, Tree){

    // Create test store, adding the getChildren() method required by ObjectStoreModel
    var myStore = new Memory({
        data: [{"parentId":5,"menuId":1,"actionUrl":"userManage","menuName":"用户管理"},{"parentId":5,"menuId":2,"actionUrl":"tableManage","menuName":"表结构管理"},{"parentId":5,"menuId":3,"actionUrl":"systemManage","menuName":"系统管理"},{"parentId":5,"menuId":4,"actionUrl":"tableList","menuName":"表结构列表"},{"parentId":0,"menuId":5,"actionUrl":"top","menuName":"顶级"}],
        getChildren: function(object){
        	alert(object.menuName);
            return this.query({parentId: object.menuId});
        }
    });

    // Create the model
    var myModel = new ObjectStoreModel({
        store: myStore,
        labelAttr:"menuName",
        query: {menuId: 5}
    });

    // Create the Tree.   Note that all widget creation should be inside a dojo.ready().
    ready(function(){
        var tree = new Tree({
            model: myModel
        });
        tree.placeAt(win.body());
        tree.startup();
    });
});</script>
</head>
<body class="claro">
    
</body>
</html>